<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">

<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <input type="hidden" name="bankNumber" id="bankNumber" th:value="${bankNumber}"/>
            <input type="hidden" name="userName" id="userName" th:value="${userName}"/>
            <input type="hidden" name="userId" id="userId" th:value="${userId}"/>
            <input type="hidden" name="insertTime" id="insertTime" th:value="${insertTime}"/>/>

        </div>

        <div class="btn-group-sm hidden-xs" id="toolbar" role="group">
        </div>
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table" data-mobile-responsive="true"></table>
        </div>
    </div>
</div>
<div th:include="include :: footer"></div>
<script th:inline="javascript">
    var prefix = ctx + "system/orderGg";

    function queryParams(params) {
        return {
            bankNumber: $("#bankNumber").val(),
            userName: $("#userName").val(),
            insertTime: $("#insertTime").val(),
            userId: $("#userId").val(),
            pageSize: params.limit,
            pageNum: params.offset / params.limit + 1,
            searchValue: params.search,
            orderByColumn: params.sort,
            isAsc: params.order
        };
    }


    $(function () {
        var options = {
                url: prefix + "/listByBankNumber",
                modalName: "光谷订单对账",
                search: false,
                queryParams: queryParams,
                showExport: true,
                columns: [{
                    checkbox: true
                },
                    {
                        field: 'id',
                        title: '主键id',
                        visible: false
                    },
                    {
                        field: 'insertTime',
                        title: '订单创建时间',
                        align: 'center',
                    },
                    {
                        field: 'userName',
                        title: '商户名称',
                        align: 'center',
                    },
                    {
                        field: 'idCard',
                        title: '身份证号',
                        align: 'center',
                    },
                    {
                        field: 'bankNumber',
                        title: '银行卡号',
                    },
                    {
                        field: 'acqCode',
                        title: '通道编号',
                        align: 'center',
                    },
                    {
                        field: 'acqName',
                        title: '通道名称',
                        align: 'center',
                    },
                    {
                        field: 'acqUserId',
                        title: '上游用户id',
                        align: 'center',
                    },
                    {
                        field: 'acqOrderId',
                        title: '上游订单编号',
                        align: 'center',
                    },
                    {
                        field: 'orderId',
                        title: '订单编号',
                        align: 'center',
                    },

                    {
                        field: 'orderAmount',
                        title: '交易金额',
                        align: 'center',
                    }
                    ,
                    {
                        field: 'orderType',
                        title: '交易类型',
                        align: 'center',
                        formatter: function (value, row, index) {
                            console.log(value)
                            if (value == 0) {
                                return "<strong style='color: lightskyblue'>消费</strong>";
                            } else if (value == 1) {
                                return "<strong style='color: red'>代付</strong>";
                            } else {
                                return ""
                            }

                        }
                    },
                    {
                        field: 'payRate',
                        title: '交易费率',
                        align: 'center',
                    }
                    ,
                    {
                        field: 'payPro',
                        title: '交易笔数费',
                        align: 'center',
                    }
                    ,
                    {
                        field: 'orderStatus',
                        title: '订单状态',
                        align: 'center',
                    }
                    ,
                ]
            }
        ;
        $.table.init(options);
    });

    /*跳转计划明细页面*/
    function detail(id) {
        var url = prefix + '/detail/' + id;
        createMenuItem(url, "订单明细");
    }
</script>
</body>
</html>